package club.xinghe.biz;

import club.xinghe.dao.ScoreDao;
import club.xinghe.entity.Score;
import club.xinghe.util.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * 说明:对学生成绩进行操作的业务
 */
public class ScoreBiz {
    //调用mybatis工厂函数
    SqlSession session= SqlSessionFactoryUtil.getSqlSession();
    //获得代理
    ScoreDao scoreDao=session.getMapper(ScoreDao.class);

    //1.查所有成绩
     public List<Score> getAllScore(){
         return scoreDao.getAllScore();
    }
    //2.查成绩>70学生
    public List<Score> getName70(){
        return scoreDao.getName70();
    }
    //3.查看该生的成绩
    public Score  getScoreBySidEid(int sid,int eid){
         return scoreDao.getScoreBySidEid(sid,eid);
    }
    //4.将学生考试成绩按sid,eid,zid存入成绩表
    public int putScore(int sid,int eid,int cj,int zid){

        int a=scoreDao.putScore(sid,eid,cj,zid);
         session.commit();
        return a;
    }






}
